package org.grow.jssp.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.servlet.HttpServletBean;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.List;

@Controller

public class AuthController {

    @GetMapping("/index")
    public ModelAndView doGet(HttpServletRequest request, HttpServletResponse response){
        System.out.println("==========");
        List<String> results = Arrays.asList("zhangsahn","lisi");
        String username = "Lucy";
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("login");
        modelAndView.addObject("friends",results);
        modelAndView.addObject("username",username);
        return modelAndView;
    }


}
